package IO;

import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("bos.txt");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        String str="为了你偷偷地学会了吉他";
        byte[]data=str.getBytes(StandardCharsets.UTF_8);
        bos.write(data);
        bos.flush();
        System.out.println("写出完毕");
    }
}
